<html>
<head><meta charset="utf-8"><title>incr session finalizing · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html">incr session finalizing</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="185292713"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185292713" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185292713">(Jan 10 2020 at 09:06)</a>:</h4>
<p><span class="user-mention" data-user-id="124287">@mw</span> Is there some particular reason we run <code>finalize_session_directory</code> after linking?</p>



<a name="185292786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185292786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185292786">(Jan 10 2020 at 09:07)</a>:</h4>
<p>One reason could be that we don't want the directory to be finalized if there are any linking errors</p>



<a name="185292841"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185292841" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185292841">(Jan 10 2020 at 09:08)</a>:</h4>
<p>but I don't know if that is even validated properly at the moment</p>



<a name="185292859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185292859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185292859">(Jan 10 2020 at 09:08)</a>:</h4>
<p>other than that I think the session directory will only contain pre-linking artifacts</p>



<a name="185292879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185292879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185292879">(Jan 10 2020 at 09:09)</a>:</h4>
<p>at least as long as we don't do any incremental linking</p>



<a name="185292965"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185292965" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185292965">(Jan 10 2020 at 09:10)</a>:</h4>
<p>but the main reason it's done this way is probably that it was a safe choice and there was no reason to do it earlier at the time</p>



<a name="185293098"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185293098" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185293098">(Jan 10 2020 at 09:12)</a>:</h4>
<p>I made it run in parallel with linking, let's see if any errors pop up.</p>



<a name="185293131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185293131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185293131">(Jan 10 2020 at 09:13)</a>:</h4>
<p>that's probably fine</p>



<a name="185293194"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185293194" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185293194">(Jan 10 2020 at 09:14)</a>:</h4>
<p>how much work is being done in <code>finalize_session_directory</code> these days? If it is just renaming the directory, then it probably doesn't matter</p>



<a name="185293212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185293212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185293212">(Jan 10 2020 at 09:14)</a>:</h4>
<p>Takes 0.3 seconds for syntex_syntax</p>



<a name="185293662"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185293662" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185293662">(Jan 10 2020 at 09:23)</a>:</h4>
<p>that might be the call  to <code>garbage_collect_session_directories</code></p>



<a name="185293715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185293715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185293715">(Jan 10 2020 at 09:24)</a>:</h4>
<p>we should certainly keep this change in mind if any bug reports come in</p>



<a name="185293767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185293767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185293767">(Jan 10 2020 at 09:25)</a>:</h4>
<p>these filesystem operations often cause hard to reproduce bugs and behavior can vary quite a bit between platforms, filesystems, OS versions, etc.</p>



<a name="185308734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185308734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185308734">(Jan 10 2020 at 13:17)</a>:</h4>
<p>I've taken a look at <code>finalize_session_directory</code> and it does read <code>sess.has_errors_or_delayed_span_bugs()</code>. If anything in linking can change that value then I am against doing the two things in parallel, since the finalization outcome would depend on a race.</p>



<a name="185357914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185357914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185357914">(Jan 10 2020 at 22:30)</a>:</h4>
<p>We can just read that before spawning it off</p>



<a name="185476387"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185476387" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185476387">(Jan 13 2020 at 09:24)</a>:</h4>
<p>I wonder if there is a way to make this safe. E.g. by making sure that linking and finalization don't access shared mutable state (like the session directory).</p>



<a name="185480215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/incr%20session%20finalizing/near/185480215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Zoxc <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/incr.20session.20finalizing.html#185480215">(Jan 13 2020 at 10:22)</a>:</h4>
<p>I did notice that something still accessed the session directory while linking, not sure what though.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>